package com.suray.wcs.service.pojo.rgv.rgv.protocol.base;

import com.suray.basic.wcs.utils.Crc16;
import com.suray.basic.wcs.utils.comm.BaseMessage;
import com.suray.wcs.service.pojo.Rgv;

public abstract class RgvBaseMessage extends BaseMessage {

    private Rgv rgv;

    public abstract Integer getMessageLife();

    public abstract Integer getMessageType();

    public RgvBaseMessage(Rgv rgv, String clazz) {
        super(clazz, true);

        this.rgv = rgv;
    }

    public Rgv getRgv() {
        return rgv;
    }

    public int calcCrc(byte[] bytes, int len) {
        return Crc16.CRC_XModem(bytes, len);
    }

}
